import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutView from '../views/LayoutView.vue'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'LayoutView',
    component: LayoutView,
    children: [
      //主页
      {
        path: '',
        name: 'Home',
        component: HomeView,
      },
      //估损直接修理
      {
        path: '/service/details',
        name: 'ServiceDetails',
        component: () => import('../views/ServiceDetails.vue')
      },
      //汽车品牌选择
      {
        path: '/car/brand',
        name: 'CarBrand',
        component: () => import('../views/CarBrand.vue')
      },
      //选择车型
      {
        path: '/choose/model',
        name: 'ChooseModel',
        component: () => import('../views/ChooseModel.vue')
      },
      //选择受损部位
      {
        path: '/maintenance/site',
        name: 'MaintenanceSite',
        component: () => import('../views/MaintenanceSite.vue')
      },
      //确认订单
      {
        path: '/confirm/order',
        name: 'ConfirmOrder',
        component: () => import('../views/ConfirmOrder.vue')
      },
      //支付页面
      {
        path: '/payment/interface',
        name: 'PaymentInterface',
        component: () => import('../views/PaymentInterface.vue')
      },
    ]
  },

  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
